<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>react-demo-01</title>
  </head>
  <body>
    <!-- 准备容器 -->
    <div id="main"></div>

    <!-- 引入react核心库 -->
    <script
      type="text/javascript"
      src="https://cdn.bootcdn.net/ajax/libs/react/17.0.2/umd/react.development.js"
    ></script>
    <!-- 引入react-dom，用于操作dom -->
    <script
      type="text/javascript"
      src="https://cdn.bootcdn.net/ajax/libs/react-dom/17.0.2/umd/react-dom.development.js"
    ></script>
    <!-- 引入babel，用于编译jsx -->
    <script src="https://cdn.bootcdn.net/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script>

    <!-- 此处一定要写babel，用于提示babel对该内容进行编译 -->
    <script type="text/babel">
      // 1. 创建虚拟Dom
      const VDom = <h1>Hello, React</h1>;
      // 2. 渲染虚拟Dom到页面
      ReactDOM.render(VDom, document.getElementById('main'));
      console.log(ReactDOM);
    </script>
  </body>
</html>
